package com.yanyeori.springaop.service.impl;

import com.yanyeori.springaop.service.CalculatorService;
import org.springframework.stereotype.Service;

/**
 * 计算器类
 */
@Service
public class CalculatorServiceImpl implements CalculatorService {
    //加
    @Override
    public Integer add(Integer i, Integer j) {
        System.out.println("日志：调用了add，参数i=" + i + "，j=" + j);
        Integer result = i + j;
        System.out.println("日志：result=" + result);
        return result;
    }

    //减
    @Override
    public Integer sub(Integer i, Integer j) {
        Integer result = i - j;
        return result;
    }

    //乘
    @Override
    public Integer mul(Integer i, Integer j) {
        Integer result = i * j;
        return result;
    }

    //除
    @Override
    public Integer div(Integer i, Integer j) {
        Integer result = i / j;
        return result;
    }
}
